<?php
/* @var $this LibraryController */
/* @var $model Library */

?>
<div class="row">
	<div class="span12">
		<div style="padding: 10px;">
			<h2>CABS Library of Games</h2>
			<p>The CABS library currently consists of <?php echo count($model); ?> games, with expansions occasionally packed in.</p>
		</div>
		<div id="games-library">
			<?php foreach ($model as $content) { ?>
				<?php if(!($content->parentId)) {?>
					<p><strong><?php echo $content->name; ?> </strong>
					<?php if($content->game->bggId) { ?>
						<a href="http://boardgamegeek.com/game/<?php echo $content->game->bggId; ?>" target="_blank"><img src="/images/bggButton.png" alt="<?php echo $content->game->bggId; ?>" /></a>
					<?php } ?>
					<br />
					<?php if($content->includedGames) { ?>
						Includes:<br />
						<?php foreach ($content->includedGames as $included) { ?>
							<?php echo $included->name;?><br />
						<?php } ?>
					<?php } ?>
				<?php } ?>
				</p>
			<?php } ?>
		</div>
	</div>
</div>